//
// Created on 2024/3/12.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#include "GlobalInfoMap.h"
#include <unistd.h>

GlobalInfoMap *GlobalInfoMap::globalInfoMap = nullptr;

GlobalInfoMap::GlobalInfoMap(){
}

GlobalInfoMap::~GlobalInfoMap() {
}


 VideoPlayerInfo *GlobalInfoMap::getVideoPlayerInfo(int32_t viewTag){
    return videoPlayerGlobalMap[viewTag];
}

void GlobalInfoMap::addVideoPlayerInfo(int32_t viewTag, VideoPlayerInfo *videoPlayerInfo) {
    videoPlayerGlobalMap[viewTag] = videoPlayerInfo;
}

void GlobalInfoMap::deleteVideoByTag(int32_t viewTag){
    if(videoPlayerGlobalMap[viewTag]){
       delete videoPlayerGlobalMap[viewTag];
    }
    videoPlayerGlobalMap.erase(viewTag);
}